package org.kingkong.framework.grid;

import java.util.HashMap;
import java.util.logging.Logger;

import org.kingkong.framework.annotation.SessionBean;

@SessionBean
public class GridBuilder extends HashMap<String, GridAnnotationResolver> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1042145909351105518L;

	private static final Logger logger = Logger.getLogger("GridBuilder");

	@Override
	public GridAnnotationResolver get(Object definition) {
		GridAnnotationResolver annotationResolver = super.get(definition);
		if (annotationResolver == null) {
			annotationResolver = new GridAnnotationResolver((String) definition);
			super.put((String) definition, annotationResolver);
			logger.info(definition + " resolved");
		}
		return annotationResolver;
	}

}
